home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / QuickDraw™ GX v1.0ß2 / Interfaces & Libraries / interfaces / graphics libraries.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-29  |  25.7 KB  |  466 lines  |  [TEXT/MPS ]

  1. /* graphics libraries:
  2.         general library interfaces
  3.         by Cary Clark, Georgiann Delaney, Michael Fairman, Dave Good, Robert Johnson, Keith McGreggor, Oliver Steele, David Van Brink, Chris Yerga
  4.         Copyright 1987 - 1991 Apple Computer, Inc.  All rights reserved.        */
  5.  
  6. #pragma once
  7. #ifndef graphicsLibrariesIncludes
  8.         #define graphicsLibrariesIncludes
  9.  
  10.         #ifndef graphicsRoutinesIncludes
  11.                 #include "graphics routines.h"
  12.         #endif
  13.         #ifndef mathRoutinesIncludes
  14.                 #include "math routines.h"
  15.         #endif
  16.  
  17.         #ifndef qdTextIncludes
  18.                 #define DrawChar gDrawChar
  19.         #endif
  20.  
  21.         /*      We use “if( a ) b; else” instead of “{ if (a ) b; }” because the first one can be used in an if-else
  22.                 statement and the second one can’t (due to the “;” at the end of the macro instance. */
  23.  
  24.         #define NilShapeReturn(a)                       if ((a) == (gxShape) nil) {GXPostGraphicsError(shape_is_nil); return; } else
  25.         #define NilShapeReturnNil(a)            if ((a) == (gxShape) nil) {GXPostGraphicsError(shape_is_nil); return 0L; } else
  26.         #define NilStyleReturn(a)                       if ((a) == (gxStyle) nil) {GXPostGraphicsError(style_is_nil); return; } else
  27.         #define NilStyleReturnNil(a)            if ((a) == (gxStyle) nil) {GXPostGraphicsError(style_is_nil); return 0L; } else
  28.         #define NilInkReturn(a)                 if ((a) == (gxInk) nil) {GXPostGraphicsError(ink_is_nil); return; } else
  29.         #define NilInkReturnNil(a)                      if ((a) == (gxInk) nil) {GXPostGraphicsError(ink_is_nil); return 0L; } else
  30.         #define NilTransformReturn(a)           if ((a) == (gxTransform) nil) {GXPostGraphicsError(transform_is_nil); return; } else
  31.         #define NilTransformReturnNil(a)        if ((a) == (gxTransform) nil) {GXPostGraphicsError(transform_is_nil); return 0L; } else
  32.         #define NilColorSetReturn(a)            if ((a) == (gxColorSet) nil) {GXPostGraphicsError(colorSet_is_nil); return; } else
  33.         #define NilColorSetReturnNil(a)         if ((a) == (gxColorSet) nil) {GXPostGraphicsError(colorSet_is_nil); return 0L; } else
  34.         #define NilColorProfileReturn(a)        if ((a) == (gxColorProfile) nil) {GXPostGraphicsError(colorProfile_is_nil); return; } else
  35.         #define NilColorProfileReturnNil(a)     if ((a) == (gxColorProfile) nil) {GXPostGraphicsError(colorProfile_is_nil); return 0L; } else
  36.         #define NilTagReturn(a)                 if ((a) == (gxTag) nil) {GXPostGraphicsError(tag_is_nil); return; } else
  37.         #define NilTagReturnNil(a)              if ((a) == (gxTag) nil) {GXPostGraphicsError(tag_is_nil); return 0L; } else
  38.  
  39.         #ifdef debugging
  40.                 /* just in case the application (or the graphics system) redefined these to something weird... */
  41.                 #undef DebugStr
  42.                 #undef IfDebug
  43.  
  44.                 #define IfDebug(a, b)                           if (a) DebugStr(b); else
  45.                 #define IfDebugReturn(a, b)             if (a) { DebugStr(b); return; } else
  46.                 #define IfDebugReturnNil(a, b)          if (a) { DebugStr(b); return 0L; } else
  47.                 #define NilParamReturn(a)               if ((a) == 0L) {GXPostGraphicsError(parameter_is_nil); return; } else     
  48.                 #define NilParamReturnNil(a)            if ((a) == 0L) {GXPostGraphicsError(parameter_is_nil); return 0L; } else  
  49.                 #define IfErrorReturn(a,b)              if (a) { GXPostGraphicsError(b); return; } else
  50.                 #define IfErrorReturnNil(a,b)           if (a) { GXPostGraphicsError(b); return 0L; } else
  51.                 #define IfNotice(a, b)                  if (a) GXPostGraphicsNotice(b); else
  52.                 #define IfWarning(a,b)                  if (a) GXPostGraphicsWarning(b); else
  53.                 #define IfWarningReturn(a,b)            if (a) { GXPostGraphicsWarning(b); return; } else
  54.                 #define IfWarningReturnNil(a,b)         if (a) { GXPostGraphicsWarning(b); return 0L; } else
  55.         #else
  56.                 #define IfDebug(a, b)
  57.                 #define IfDebugReturn(a, b)
  58.                 #define IfDebugReturnNil(a, b)
  59.                 #define NilParamReturn(a)
  60.                 #define NilParamReturnNil(a)
  61.                 #define IfErrorReturn(a,b)
  62.                 #define IfErrorReturnNil(a,b)
  63.                 #define IfNotice(a, b)
  64.                 #define IfWarning(a,b)
  65.                 #define IfWarningReturn(a,b)            if (a) return; else
  66.                 #define IfWarningReturnNil(a,b) if (a) return 0L; else
  67.         #endif
  68.  
  69.  
  70.         typedef enum {
  71.                         /* gxColor names */
  72.                 gxWhite = 1,            gxBlack,                                gxGray,                         gxGrey = gxGray,
  73.         #ifndef __QUICKDRAW__
  74.                 white = 1,                      black,                          gray,                           grey = gray,
  75.         #endif
  76.                         /* primaries */
  77.                 red,                            green,                          blue,
  78.                         /* secondaries */
  79.                 cyan,                   magenta,                                yellow,
  80.                         /* tertiaries */
  81.                 orange,                 chartreuse,                     aqua,                           teal = aqua,
  82.                 slate,                  purple,                         violet = purple,                        maroon,
  83.                         /* others */
  84.                 brown,                  pink,                                   turquoise,
  85.                 cadmium_lemon,  cadmium_light_yellow,   aureoline_yellow,               naples_deep_yellow,
  86.                 cadmium_yellow, cadmium_deep_yellow,    cadmium_orange,         cadmium_light_red,
  87.                 cadmium_deep_red,       geranium_lake,                  alizarin_crimson,               rose_madder,
  88.                 madder_deep_lake,       brown_madder,                   permanent_red_violet,   cobalt_deep_violet,
  89.                 ultramarine_violet,     ultramarine_blue,               cobalt_blue,                    royal_blue,
  90.                 cerulean_blue,          manganese_blue,         indigo,                         turquoise_blue,
  91.                 emerald_green,          permanent_green,                viridian_light,                 cobalt_green,
  92.                 cinnabar_green, sap_green,                      chromium_oxide_green,   terre_verte,
  93.                 yellow_ochre,           mars_yellow,                    raw_sienna,                     mars_orange,
  94.                 gold_ochre,             brown_ochre,                    deep_ochre,                     burnt_umber,
  95.                 burnt_sienna,           flesh,                          flesh_ochre,                    english_red,
  96.                 venetian_red,           indian_red,                     raw_umber,                      greenish_umber,
  97.                 van_dyck_brown, sepia,                          warm_grey,                      cold_grey,
  98.                 ivory_black,            lamp_black,                     titanium_white,         zinc_white,
  99.                 pale_gold,                      gold,                                   old_gold,                               pink_gold,
  100.                 white_gold,             yellow_gold,                    green_gold,                     platinum,
  101.                 silver,                 antique_silver,                 chrome,                         steel,
  102.                 copper,                 antique_copper,         oxidized_copper,                bronze,
  103.                 brass,                  iron,                                   rusted_iron,                    lead,
  104.                 fluorescent_pink,       fluorescent_green,              fluorescent_blue,
  105.                 incadescent_high,       incadescent_low,
  106.                 moonlight,                      sodium,                         daylight,                               dawn,
  107.                 afternoon,                      dusk,
  108.                 mauve,
  109.                 apple_green,            apple_yellow,                   apple_orange,                   apple_red,
  110.                 apple_purple,           apple_blue,
  111.  
  112.                 /* gxColor modifiers */
  113.                 light = 512,
  114.                 dark = 1024,
  115.                 warm = 2048,
  116.                 reddish = warm,
  117.                 cool = 4096,
  118.                 bluish = cool,
  119.                 grayish = 8192,
  120.                 whitish = light,
  121.                 blackish = dark,
  122.                 greenish = 16384
  123.         } commonColors;
  124.  
  125.  
  126.         typedef long commonColor;
  127.  
  128.         extern gxColorSet commonColorSet;
  129.         extern gxSetColor commonColorList[];
  130.         extern short commonColorCount;
  131.  
  132. /* some very useful constructive definitions for creating colors */
  133. /* see 'gxColor library.c' for an example of their use... */
  134.  
  135.         #define makeRGBSHORT(a,b,c) ((c >> 14) + ((b >> 13) + (a >> 13) << 3) << 3)
  136.         #define makeCMYKSHORT(a,b,c,d) ((d >> 14) + ((c >> 14) + ((b >> 14) + (a >> 14) << 2) << 2) << 2)
  137.         #define makeRGB16(a,b,c) ((c >> 11) + ((b >> 11) + (a >> 11) << 5) << 5)
  138.         #define makeCMYK16(a,b,c,d) ((d >> 12) + ((c >> 12) + ((b >> 12) + (a >> 12) << 4) << 4) << 4)
  139.         #define xRGB256(a,b,c) {gxRGBSpace,nil,{(a << 8)+a,(b << 8)+b,(c << 8)+c, 0 }}
  140.  
  141.         #define xRGB(a,b,c)     {gxRGBSpace,nil,{a,b,c,0}}
  142.         #define xCMYK(a,b,c,d)  {gxCMYKSpace,nil,{a,b,c,d}}
  143.         #define xHSV(a,b,c) {gxHSVSpace,nil,{a,b,c,0}}
  144.         #define xCIE(a,b,c) {gxCIESpace,nil,{a,b,c,0}}
  145.         #define xYIQ(a,b,c) {gxYIQSpace,nil,{a,b,c,0}}
  146.         #define xXYZ(a,b,c) {gxXYZSpace,nil,{a,b,c,0}}
  147.         #define xYUV(a,b,c) {yuvSpace,nil,{a,b,c,0}}
  148.         #define xLUV(a,b,c) {gxLUVSpace,nil,{a,b,c,0}}
  149.         #define xLAB(a,b,c) {gxLABSpace,nil,{a,b,c,0}}
  150.         #define xHLS(a,b,c) {gxHLSSpace,nil,{a,b,c,0}}
  151.         #define xACC(a,b,c) {accSpace,nil,{a,b,c,0}}
  152.         #define xNTSC(a,b,c) {gxNTSCSpace,nil,{a,b,c,0}}
  153.         #define xPAL(a,b,c) {gxPALSpace,nil,{a,b,c,0}}
  154.         #define xSECAM(a,b,c) {secamSpace,nil,{a,b,c,0}}
  155.         #define xDIGITALVIDEO(a,b,c) {digitalVideoSpace,nil,{a,b,c,0}}
  156.         #define xGRAY(a) {gxGraySpace,nil,{a,0,0,0}}
  157.         #define xRGB16(a,b,c) {gxRGB16Space,nil,{makeRGB16(a,b,c),0,0,0}}
  158.         #define xCMYK16(a,b,c,d) {cmyk16Space,nil,{makeCMYK16(a,b,c,d),0,0,0}}
  159.         #define xRGB32(a,b,c) {gxRGB32Space,nil,{(a >> 8),((c >> 8) + (b >> 8) << 8),0,0}}
  160.         #define xCMYK32(a,b,c,d) {gxCMYK32Space,nil,{((b >> 8) + (a >> 8) << 8),((d >> 8) + (c >> 8) << 8),0,0}}
  161.  
  162.         #define sRGB(r,g,b) {r,g,b,0}
  163.         #define sCMYK(c,m,y,k) {c,m,y,k}
  164.         #define sRGB256(a,b,c) {(a << 8)+a,(b << 8)+b,(c << 8)+c, 0 }
  165.  
  166. #ifndef __TYPES__
  167. /* The following items are duplicated in Types.h, so we skip them here. */
  168.         typedef enum {
  169.                 bold = 1,
  170.                 italic = 2,
  171.                 underline = 4,
  172.                 outline = 8,
  173.                 shadow = 0x10,
  174.                 condense = 0x20,
  175.                 extend = 0x40
  176.         } commonFaces;
  177.  
  178. #endif /* ifndef __TYPES__ */
  179.  
  180.         enum {
  181.                 plain,
  182.                 lighten = 0x80
  183.                 };
  184.  
  185.         typedef char commonFace;
  186.  
  187.  
  188.         typedef enum {                                          /* These modes simulate QuickDraw's transfer modes              */
  189.                 commonAddOverMode = 2000,
  190.                 commonSubtractOverMode,
  191.                 commonSubtractPinMode,
  192.                 commonTransparentMode,
  193.                 commonInMode,
  194.                 commonOutMode
  195.         } commonTransferModes;
  196.  
  197.         typedef short commonTransferMode;
  198.         
  199.         typedef struct {
  200.                 gxPoint a;
  201.                 gxPoint b;
  202.                 gxPoint c;
  203.                 gxPoint d;
  204.         } cubic;
  205.  
  206.         typedef struct {
  207.                 gxPoint a;
  208.                 gxPoint b;
  209.                 gxPoint c;
  210.                 fixed lambda;
  211.         } conic;
  212.  
  213.         /* gxShape library */
  214.         gxShape NewPath(const gxPath *);
  215.         gxShape NewPolygon(const gxPolygon *);
  216.         gxPolygon *GetPolygon(gxShape, long contour, gxPolygon *);
  217.         gxPath *GetPath(gxShape, long contour, gxPath *);
  218.         void SetPath(gxShape, long contour, const gxPath *);
  219.         void SetPolygon(gxShape, long contour, const gxPolygon *);
  220.         void DrawPolygon(const gxPolygon *, gxShapeFill);
  221.         void DrawPath(const gxPath *, gxShapeFill);
  222.  
  223.         void SetShapeIndexPoint(gxShape, long index, const gxPoint *);
  224.         void SetShapeIndexControl(gxShape, long index, long control);
  225.         gxPoint *GetShapeIndexPoint(gxShape, long index, gxPoint *);
  226.         long GetShapeIndexControl(gxShape, long index, long *control);
  227.  
  228.         void InsertShape(gxShape, long index, gxShape toAdd);
  229.         gxShape ExtractShape(gxShape source, long firstPoint, long numPoints);
  230.         void AddToShape(gxShape dest, gxShape add);
  231.         void ExtendShape(gxShape dest, gxShape add);
  232.  
  233.         #ifdef debugging
  234.                 gxShape NewShape2(gxShapeType, fixed, fixed);
  235.                 gxShape NewShape4(gxShapeType, fixed, fixed, fixed, fixed);
  236.                 gxShape NewShape6(gxShapeType, fixed, fixed, fixed, fixed, fixed, fixed);
  237.  
  238.                 void SetShape2(gxShape, fixed, fixed);
  239.                 void SetShape4(gxShape, fixed, fixed, fixed, fixed);
  240.                 void SetShape6(gxShape, fixed, fixed, fixed, fixed, fixed, fixed);
  241.         #else
  242.                 #define NewShape2(type,p1,p2)                           NewShapeMany(type, (fixed)p1, (fixed)p2)
  243.                 #define NewShape4(type,p1,p2, p3, p4)                   NewShapeMany(type, (fixed)p1, (fixed)p2, (fixed)p3, (fixed)p4)
  244.                 #define NewShape6(type,p1,p2, p3, p4, p5, p6)   NewShapeMany(type, (fixed)p1, (fixed)p2, (fixed)p3, (fixed)p4, (fixed)p5, (fixed)p6)
  245.  
  246.                 #define SetShape2(source,p1,p2)                         SetShapeMany(source, (fixed)p1, (fixed)p2)
  247.                 #define SetShape4(source,p1,p2, p3, p4)                 SetShapeMany(source, (fixed)p1, (fixed)p2, (fixed)p3, (fixed)p4)
  248.                 #define SetShape6(source,p1,p2, p3, p4, p5, p6) SetShapeMany(source, (fixed)p1, (fixed)p2, (fixed)p3, (fixed)p4, (fixed)p5, (fixed)p6)
  249.         #endif
  250.         
  251.         gxShape NewShapeMany(gxShapeType type, fixed firstArg, ...);
  252.         void SetShapeMany(gxShape target, fixed firstArg, ...);
  253.         
  254.         gxShape GetBitmapPartsFromFixedBounds(gxShape source, const gxRectangle *bounds);
  255.         void SetBitmapPartsFromFixedBounds(gxShape target, const gxRectangle *bounds, gxShape bitmapShape);
  256.  
  257.         /* arc library, oval library, roundrect library, cubic library, and conic library */
  258.         gxShape NewArc(const gxRectangle *, fixed startAng, fixed sweep, boolean wedge);
  259.         gxShape NewOval(const gxRectangle *);
  260.         gxShape NewRoundRect(const gxRectangle *, const gxPoint *ovalSize);
  261.         gxShape NewCubic(const cubic*);
  262.         gxShape NewConic(const conic*);
  263.  
  264.         void DrawArc(const gxRectangle *, fixed startAng, fixed sweep, boolean wedge);
  265.         void DrawOval(const gxRectangle *, gxShapeFill);
  266.         void DrawRoundRect(const gxRectangle *, const gxPoint *ovalSize, gxShapeFill);
  267.         void DrawCubic(const cubic *, gxShapeFill);
  268.         void DrawConic(const conic *, gxShapeFill);
  269.  
  270.         void SetArc(gxShape, const gxRectangle *, fixed startAng, fixed sweep, boolean wedge);
  271.         void SetOval(gxShape, const gxRectangle *);
  272.         void SetRoundRect(gxShape, const gxRectangle *, const gxPoint *ovalSize);
  273.         void SetCubic(gxShape, const cubic *);
  274.         void SetConic(gxShape, const conic *);
  275.         
  276.         /* graphics debug library */
  277.         void SetGraphicsLibraryErrors(void);    /* set the error and warning routines */
  278.         void SetGraphicsLibraryNotices(void);   /* set the notice routine */
  279.         char *GraphicsErrorMessage(gxGraphicsError);
  280.         char *GraphicsWarningMessage(gxGraphicsWarning);
  281.         char *GraphicsNoticeMessage(gxGraphicsNotice);
  282.         void DisplayGraphicsErrorMessage(gxGraphicsError, long);
  283.         void DisplayGraphicsWarningMessage(gxGraphicsWarning, long);
  284.         void DisplayGraphicsNoticeMessage(gxGraphicsNotice, long);
  285.         
  286.         /* gxShape library */
  287.         void CenterShape(gxShape, gxRectangle *);
  288.         void MoveShapeCenterTo(gxShape, fixed x, fixed y);
  289.         void RotateShapeAboutCenter(gxShape, fixed degrees);
  290.         void SkewShapeAboutCenter(gxShape, fixed xSkew, fixed ySkew);
  291.         void ScaleShapeAboutCenter(gxShape, fixed hScale, fixed vScale);
  292.         
  293.         /* graphics library */
  294.         void MapShapeToSpace(gxShape, gxViewPort, gxViewDevice);
  295.         void MapShapeFromSpace(gxShape, gxViewPort, gxViewDevice);
  296.         void MapPointToSpace(gxPoint *, gxViewPort, gxViewDevice);
  297.         void MapPointFromSpace(gxPoint *, gxViewPort, gxViewDevice);
  298.         
  299.         /* gxTransform library */
  300.         gxViewPort GetTransformViewPort(gxTransform);
  301.         void SetTransformViewPort(gxTransform, gxViewPort);
  302.         void AddToTransformViewPort(gxTransform target, gxViewPort);
  303.         void SetShapeViewPort(gxShape, gxViewPort);
  304.         gxViewPort GetShapeViewPort(gxShape);
  305.         void SetDeepShapeViewPort(gxShape, gxViewPort);
  306.         void SetDeepShapeViewPorts(gxShape, long count, const gxViewPort portList[]);
  307.         void SetDeepShapeTransform(gxShape, gxTransform);
  308.         void SetDefaultViewPort(gxViewPort);
  309.         gxViewGroup CopyViewGroup(gxViewGroup group);
  310.         gxTransform ChangeTransformViewGroup(gxTransform xform, gxViewGroup oldGroup, gxViewGroup newGroup);
  311.         gxShape ChangeShapeViewGroup(gxShape source, gxViewGroup oldGroup, gxViewGroup newGroup);
  312.         gxTransform SeparateShapeTransform(gxShape source);
  313.         void ReuniteShapeTransform(gxShape target, gxTransform separate);
  314.         
  315.         /* graphics state library */
  316.         gxStyle SeparateShapeStyle(gxShape source);
  317.         void ReuniteShapeStyle(gxShape target, gxStyle separate);
  318.         gxInk SeparateShapeInk(gxShape source);
  319.         void ReuniteShapeInk(gxShape target, gxInk separate);
  320.         
  321.         /* gxShape library */
  322.         void GetPathsIndexPointControl(const gxPaths *source, long index, gxPoint **pt, long **controlPtr, long *controlMask);
  323.         void SetShapeOpenPath(gxShape target);
  324.         void PreMapTransform(gxTransform source, gxMapping *map);
  325.         
  326.         /* graphics library */
  327.         #define CopyShape(s) GXCopyToShape(nil,s)
  328.         #define CopyStyle(s) GXCopyToStyle(nil,s)
  329.         #define CopyInk(s) GXCopyToInk(nil,s)
  330.         #define CopyTransform(s) GXCopyToTransform(nil,s)
  331.         void DisposeTransformAt(gxTransform *target);
  332.         void DisposeShapeAt(gxShape *target);
  333.         void DisposeStyleAt(gxStyle *target);
  334.         void DisposeInkAt(gxInk *target);
  335.         void DisposeTagAt(gxTag *target);
  336.  
  337.         /* gxColor matching library */
  338.         gxColorProfile CreateQMSColorProfile(void);
  339.         gxColorProfile CreateCanonColorProfile(void);
  340.         
  341.         /* gxColor library */
  342.         void InitCommonColors(void);
  343.         void DisposeCommonColors(void);
  344.         void SetShapeRGB(gxShape target, gxColorValue red, gxColorValue green, gxColorValue blue);
  345.         void SetInkRGB(gxInk target, gxColorValue red, gxColorValue green, gxColorValue blue);
  346.         void SetShapeHSV(gxShape target, gxColorValue hue, gxColorValue saturation, gxColorValue value);
  347.         void SetInkHSV(gxInk target, gxColorValue hue, gxColorValue saturation, gxColorValue value);
  348.         void SetShapeGray(gxShape target, gxColorValue gray);
  349.         void SetInkGray(gxInk target, gxColorValue gray);
  350.         
  351.         /* gxTransferMode library, gxColor library, text library */
  352.         void SetShapeCommonTransfer(gxShape target, commonTransferMode mode);
  353.         void SetShapeCommonColor(gxShape target, commonColor gxColor);
  354.         void SetShapeCommonFace(gxShape target, commonFace face);
  355.  
  356.         void SetInkCommonTransfer(gxInk target, commonTransferMode mode);
  357.         void SetInkCommonColor(gxInk target, commonColor);
  358.         void SetStyleCommonFace(gxStyle target, commonFace);
  359.  
  360.         commonTransferMode GetInkCommonTransfer(gxInk source);
  361.         commonColor GetInkCommonColor(gxInk source);
  362.         commonFace GetStyleCommonFace(gxStyle source);
  363.  
  364.         commonTransferMode GetShapeCommonTransfer(gxShape source);
  365.         commonColor GetShapeCommonColor(gxShape source);
  366.         commonFace GetShapeCommonFace(gxShape source);
  367.  
  368.         gxColor *SetCommonColor(gxColor *target, commonColor);
  369.         commonColor GetCommonColor(const gxColor *source);
  370.  
  371.         /* gxColor library */
  372.         gxColorSpace GetShapeColorSpace(gxShape target);
  373.         gxColorProfile GetShapeColorProfile(gxShape source);
  374.         gxColorSet GetShapeColorSet(gxShape source);
  375.         gxColorSpace GetInkColorSpace(gxInk target);
  376.         gxColorProfile GetInkColorProfile(gxInk source);
  377.         gxColorSet GetInkColorSet(gxInk source);
  378.         
  379.         void SetShapeColorSpace(gxShape target, gxColorSpace space);
  380.         void SetShapeColorProfile(gxShape target, gxColorProfile profile);
  381.         void SetShapeColorSet(gxShape target, gxColorSet set);
  382.         void SetInkColorSpace(gxInk target, gxColorSpace space);
  383.         void SetInkColorProfile(gxInk target, gxColorProfile profile);
  384.         void SetInkColorSet(gxInk target, gxColorSet set);
  385.         
  386.         gxColorSet GetViewDeviceColorSet(gxViewDevice source);
  387.         void SetViewDeviceColorSet(gxViewDevice target, gxColorSet set);
  388.         gxColorProfile GetViewDeviceColorProfile(gxViewDevice source);
  389.         void SetViewDeviceColorProfile(gxViewDevice target, gxColorProfile profile);
  390.  
  391.         long GetColorSpaceComponents(gxColorSpace space);
  392.  
  393.         /* gxTransferMode library */
  394.         void InitTransferMode(gxTransferMode *);
  395.         gxTransferMode *SetCommonTransfer(gxTransferMode *transferModeRecord, commonTransferMode mode, unsigned short opValue, const gxColor *opColor);
  396.         gxColor *TransmogrifyColor(gxColor *dstColor, const gxColor *srcColor, const gxTransferMode *);
  397.         void SetInkFastXorTransfer(gxInk inky, gxViewDevice destDevice, gxColor *background, gxColor *result);
  398.         void SetShapeFastXorTransfer(gxShape source, gxColor *background, gxColor *result);
  399.         
  400.         gxShape NewCString(const char *cString, const gxPoint *position);
  401.         gxShape NewPString(const char *pascalString, const gxPoint *position);
  402.         gxShape NewChar(const char theChar, const gxPoint *position);
  403.         void SetCString(gxShape target, const char *cString, const gxPoint *position);
  404.         void SetPString(gxShape target, const char *pascalString, const gxPoint *position);
  405.         void SetChar(gxShape target, char theChar, const gxPoint *position);
  406.         void DrawCString(const char *cString, const gxPoint *position);
  407.         void DrawPString(const char *pascalString, const gxPoint *position);
  408.         #ifndef qdTextIncludes
  409.                 void DrawChar(const char theChar, const gxPoint *position);
  410.         #endif
  411.  
  412.         fixed FixTextWidth(const unsigned char *, short length);
  413.         fixed FixCStringWidth(const char *);
  414.         fixed FixPStringWidth(const char *);
  415.         fixed FixCharWidth(char);
  416.         gxPoint *GetShapeAdvance(gxShape target, gxPoint *advance);
  417.  
  418.         void SetGlyphText(gxShape, const unsigned char *text, long length);
  419.         void SetGlyphAdvance(gxShape, const long advanceBits[]);
  420.         void SetGlyphStyles(gxShape, const short styleRuns[], const gxStyle glyphStyles[]);
  421.  
  422.         long GetGlyphText(gxShape, unsigned char *text);
  423.         long GetGlyphAdvance(gxShape, long advanceBits[]);
  424.         long GetGlyphStyles(gxShape, short styleRuns[], gxStyle glyphStyles[]);
  425.  
  426.         /* gxMapping library */
  427.         void PolyToPolyMap(const gxPolygon *source, const gxPolygon *dest, gxMapping *);
  428.         
  429.         /* gxShape library */
  430.         void PaintRectangle(const gxRectangle *, commonColor);
  431.         void PaintRectangle2(const gxPoint *, const gxPoint *, commonColor);
  432.         void PaintRectangle4(long left, long top, long right, long bottom, commonColor);
  433.  
  434.         /* picture library */
  435.         void AddToPicture(gxShape picture, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  436.         void InsertPictureItem(gxShape picture, long index, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  437.         gxShape GetPictureItem(gxShape picture, long index, gxShape *destShape, gxStyle *destStyle, gxInk *destInk, gxTransform *destTransform);
  438.         void SetPictureItem(gxShape picture, long index, gxShape newShape, gxStyle newStyle, gxInk newInk, gxTransform newTransform);
  439.  
  440.         /* user library */
  441.         void AddShapeUser(gxShape source, const void *data, long length, long type);
  442.         long GetShapeUser(gxShape source, void *data, long *length, long requestedType, long *foundType, long index);
  443.         void RemoveShapeUser(gxShape source, long type, long index);
  444.  
  445.         /* ramp library */
  446.         gxShape NewRamp(const gxColor *firstColor, const gxColor *lastColor, long steps, const gxRectangle *bounds);
  447.         void DrawRamp(const gxColor *firstColor, const gxColor *lastColor, long steps, const gxRectangle *bounds);
  448.         gxShape NewCommonRamp(commonColor firstColor, commonColor lastColor, long steps, const gxRectangle *bounds);
  449.         void DrawCommonRamp(commonColor firstColor, commonColor lastColor, long steps, const gxRectangle *bounds);
  450.  
  451.         /* spline library */
  452.         #define circleSlack ((fract)0x3504f334) /* if the points form a square, this slop will approximate a circle */
  453.         enum { openSpline, closedSpline };              /* passed as the closed parameter */
  454.         gxShape MirrorSpline(long count, gxPoint *points, fract slack, boolean closed);
  455.  
  456.         /* framing libarary */
  457.         void OutsetShape(gxShape source, fixed distance);
  458.         void FrameShape(gxShape source, fixed distance);
  459.  
  460.         #ifdef MacintoshIncludes
  461.                 #ifndef qdTextIncludes
  462.                         #undef DrawChar
  463.                 #endif
  464.         #endif
  465. #endif
  466.